/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.zeke.pizzastore.vista.managedbeans;

import cl.zeke.pizzastore.negocio.entities.Comuna;
import cl.zeke.pizzastore.negocio.services.ComunesService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 *
 * @author taller
 */
@Component
@Scope("view")
public class ProcedimientoTestBean {
    
    @Autowired
    private ComunesService comunesService;
    
    private List<Comuna> comunaList;
    
    public void consumirPorJPA() {
        comunaList = comunesService.callProcedimientoPorJPA();
    }
    
    public void consumirConJdbcTemplate() {
        comunaList = comunesService.callProcedimientoPorJdbcTemplate();
    }

    public List<Comuna> getComunaList() {
        return comunaList;
    }

    public void setComunaList(List<Comuna> comunaList) {
        this.comunaList = comunaList;
    }
    
}
